import Vue from 'vue'
import VueRouter from 'vue-router'



Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/Index.vue'),
    children:[
      {
        path: '/index/home',
        name: 'home',
        component: () => import('../views/index/Home.vue')
      },
      {
        path: '/index/tuan',
        name: 'baobao',
        component: () => import('../views/index/Tuan.vue')
      },
      {
        path: '/index/order',
        name: 'order',
        component: () => import('../views/index/Order.vue')
      },
      {
        path: '/index/mine',
        name: 'mine',
        component: () => import('../views/index/Mine.vue')
      },
      {
        path: '/index',
        redirect: '/index/home'
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
